package com.shujia.api.controller;

import com.shujia.api.bean.StationDayTop;
import com.shujia.api.service.SztService;
import com.shujia.api.util.JdbcUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

@RestController
public class SztController {

    /**
     * @Autowired: 自动依赖注入，
     * 自动将创建这个类的对象赋值给这个属性
     */
    @Autowired
    private SztService sztService;

    /**
     * 查询进站人次排行榜
     */
    @GetMapping("/queryInStationDayTopByDay")
    public ArrayList<StationDayTop> queryInStationDayTopByDay(String day) throws Exception {
        System.out.println("控制层");
        return sztService.queryInStationDayTopByDay(day);
    }
}
